package cn.marinda.totipotentwar.manager;

import cn.marinda.totipotentwar.TotipotentWar;
import cn.marinda.totipotentwar.global.*;

/**
 * 配置管理器
 *
 * @author hwj
 * @date 2022/02/05
 */
public class ConfigManager {

    public static ConfigManager instance = new ConfigManager();
    private TotipotentWar plugin = TotipotentWar.plugin;
    private ConfigManager(){

    }

    /**
     * 重新加载配置
     */
    public void reloadConfig(){
        TotipotentWar.rankData = new RankData();
        TotipotentWar.scoreData = new ScoreData();
        TotipotentWar.scoreBoardData = new ScoreBoardData();
        TotipotentWar.configData = new ConfigData(plugin);
        TotipotentWar.shopData = new ShopData();
    }

    /**
     * 重新加载配置
     *
     * @param pluginConfig 插件配置
     */
    public void reloadConfig(PluginConfig pluginConfig,String configName){
        pluginConfig.reload(configName);
    }
}
